package demo1.client;

import org.apache.cxf.frontend.ClientProxyFactoryBean;
import demo1.server.IHelloService;
import demo1.server.IHelloServicePortTypeImpl;

public class HelloClient {

    public static void main(String args[]) throws Exception {

            ClientProxyFactoryBean factory = new ClientProxyFactoryBean();

            factory.setServiceClass(IHelloService.class);

            if (args != null && args.length > 0 && !"".equals(args[0])) {

                factory.setAddress(args[0]);

            } else {

                factory.setAddress("http://127.0.0.1:9000/Hello");

            }

            //factory.getServiceFactory().setDataBinding(new AegisDatabinding());

            IHelloService client = (IHelloService)factory.create();

            System.out.println(client.sayHello(1,System.getProperty("user.name")));

            System.exit(0);

        }

}